# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python2-ldap
_pkgname=python-ldap
pkgver=3.2.0
pkgrel=5
pkgdesc='Python modules for implementing LDAP clients.'
url='https://pypi.org/project/python-ldap/#files'
arch=('x86_64' 'aarch64')
license=('MIT')
depends=('python2' 'python2-pyasn1' 'python2-pyasn1-modules' 'libldap')
makedepends=('python2-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('ef2833739fd57ad26d97ae5dba3bca8a47e770ff3f113d06a5bed0841f8fcbbe6cd102e75c753dfff48f5f6041f46a91c6166f3bb9ca44ef9bd643c0666c6b23')

prepare() {
  cd "$_pkgname-$pkgver"

  sed -i 's|ldap_r|ldap|gi' setup.cfg
}

build() {
  cd "$_pkgname-$pkgver"

  python2 setup.py build
}

package() {
  cd "$_pkgname-$pkgver"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

